package com.han.yrpc.demo.provider;

import com.han.yrpc.core.CustomApplicationContext;
import com.han.yrpc.core.YrpcScan;
import com.han.yrpc.registrycenter.localcache.*;

@YrpcScan(basePackage = "com.han.yrpc")
public class ProviderStarter {

    public static void main(String[] args) {
        ServiceProvider serviceProvider = new ServiceProvider();
        ServiceRegistryHandle registryHandle = new ServiceRegistryHandle(serviceProvider);
        ServiceDiscoverHandle discoverHandle = new ServiceDiscoverHandle(serviceProvider);
        RegistryInitializer registryInitializer = new DefaultRegistryInitializer(registryHandle, discoverHandle);
        registryInitializer.initialize();

        new CustomApplicationContext(ProviderStarter.class);
    }

}
